package com.fdb.efp.cus.api.common;

import java.util.Optional;

public enum YedCompanyOnwayEnum {
    COMP_STATE_01("1","在营（开业）"),
    COMP_STATE_02("2","吊销"),
    COMP_STATE_03("3","注销"),
    COMP_STATE_04("4","迁出"),
    COMP_STATE_05("5","停"),
    COMP_STATE_06("9","其他");

    private String type;
    private String desc;
    YedCompanyOnwayEnum(String type, String desc) {
        this.type=type;
        this.desc=desc;
    }
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static YedCompanyOnwayEnum getEnum(String type) {
        for (YedCompanyOnwayEnum setlType : values()) {
            if (setlType.getType().equals(type)) {
                return setlType;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(Optional.ofNullable(YedCompanyOnwayEnum.getEnum("7")).isPresent());
    }
}
